/*
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;

public class test {
    public static void main(String[] args) {
    	
        IplImage image = cvLoadImage("1-1.jpg");
        
        if (image != null){
            cvSmooth(image, image, CV_GAUSSIAN, 4);
            cvSaveImage("My_image.jpg", image);
            cvReleaseImage(image);
        }
    }
}
*/

import com.googlecode.javacv.CanvasFrame;
import static com.googlecode.javacv.cpp.opencv_core.IplImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvLoadImage;
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;

public class test {

    public static void main(String[] args) {
        
        // read an image
        final IplImage image = cvLoadImage("sample.jpg");
            
        cvSmooth(image, image, CV_GAUSSIAN, 4);
        cvSaveImage("My_image.jpg", image);
        cvReleaseImage(image);
        
        // create image window named "My Image"
        final CanvasFrame canvas = new CanvasFrame("My image");
        
        // request closing of the application when the image window is closed
        canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
                
        // show image on window
        canvas.showImage(image);
    }
}
